<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../css/bootstrap4.5.min.css">
    <link rel="stylesheet" href="../css/public.css">
    <script src="../js/jquery-3.5.1.min.js"></script>
    <title>Document</title>
    <style>
        .com_form_box_three label {
            color: var(--c_text);
            font-size: var(--f_notes);
            line-height: var(--l_notes);
            text-align: center;
            width: 64px;
            height: 29px;
            margin-bottom: 0;
            overflow: hidden;
        }

        .com_form_flex {
            display: flex;
            flex-direction: row-reverse;
        }

        .com_form_box_three label span {
            color: red;
            padding-right: 8px;
            display: inline-block;
        }

        .com_form_box_three li {
            padding: 0;
            padding-bottom: 26px;
        }

        .com_form_box_three,
        .com_form_box_three li,
        .public_bottom_map {
            padding: 0;
        }
        .com_form_box_three li:last-child {
            padding-top: 40px;
        }
        .com_form_flex .com_form_box_three {
            padding-left: 20px;
        }

        .com_form_box_three input {
            font-size: 16px;
            width: 500px;
            padding-left: 10px;
        }

        .com_form_box_three textarea {
            width: 100%;
            padding-left: 10px;
            height: 120px;
            resize: none;
            font-size: 16px;
        }


        .com_form_box_three a {
            display: block;
            width: 200px;
            height: 32px;
            line-height: 32px;
            text-align: center;
            color: var(--c_b_nav);
            font-size: 18px;
            background-color: var(--c_theme);
            border: 1px solid var(--c_text);
            transition: 1s;
        }

        @media (max-width:1200px) {
            .com_form_box_three input {
                width: 100%;
            }
        }

        @media (max-width:768px) {

            .com_form_box_three a {
                width: 100px;
                margin: auto;
            }

            .com_form_flex .com_form_box_three {
                padding-left: 0;
                order: 2;
            }

            .com_form_box_three input,
            .com_form_box_three textarea {
                font-size: 12px;
            }

            .com_form_flex .com_form_box_three {
                padding: 0 0 20px;
                margin: auto;
            }

            .com_form_box_three li {
                padding: 0 1px 20px;
            }

            .com_form_box_three li {
                padding-bottom: 0;
                padding-top: 20px;
            }
        }

        @media (max-width:560px) {
            .com_form_box_three a {
                width: 100%;
            }

        }

        .com_form_box_hint_two,
        .com_form_box_hint_one,
        .com_form_box_hint_three,
        .com_form_box_hint_four {
            padding-left: 100px;
            color: #999;
            text-align: left;
            font-size: 16px;
        }

        .wong {
            color: green;
            text-align: left;
            padding-left: 100px;
            font-size: 16px;
        }

        .com_form_box_paralleling {
            margin: auto;
            padding-left: 20px;
        }

        .com_form_box_paralleling li:last-child {
            padding-top: 100px;
        }

        .com_form_box_paralleling li h3 {
            color: var(--c_theme);
            font-size: var(--f_subtitle_contact);
            line-height: var(--l_subtitle_contact);
        }

        .com_form_box_paralleling li p {
            font-size: var(--f_text);
            line-height: var(--l_text);
            color: var(--c_text);
        }


        @media (max-width:768px) {

            .com_form_box_hint_two,
            .com_form_box_hint_one,
            .com_form_box_hint_three,
            .com_form_box_hint_four {
                padding-left: 50px;
                color: #999;
                text-align: left;
                font-size: 12px;
            }

            .com_form_box_paralleling li:last-child {
                padding-top: 20px;
            }

            .com_form_box_paralleling {
                padding-left: 0;
                padding-right: 0;
                order: 1;
            }

            .wong {
                color: green;
                text-align: left;
                padding-left: 50px;
                font-size: 12px;
            }
        }

        /* .number {
            border: none;
        } */
        .com_form_box_show {
            border: none;
            border: 1px solid red;
        }

        .com_form_box_pass {
            border: none;
            border: 1px solid green;
        }

        .rong {
            color: red;

        }
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
</head>

<body>
    <div class="com_form modular">
        <div class="public_width">
            <div class="row com_form_flex">
                <ul class="com_form_box_three col-xl-7 col-md-6 col-12">
                    <li>
                        <div class="com_form_box_text">
                            <label for="name1"><span>*</span>姓名:</label>
                        </div>
                        <input type="text" placeholder="请输入您的姓名" id="name1" autofocus class="name">
                        <p class="com_form_box_hint_one"></p>
                    </li>
                    <li>
                        <div class="com_form_box_text">
                            <div class="com_form_box_text">
                                <label for="name1"><span>*</span>电话:</label>
                            </div>
                        </div>
                        <input type="text" placeholder="请输入您的手机号" id="name2" class="number"><br />
                        <p class="com_form_box_hint_two"></p>
                    </li>
                    <li>
                        <div class="com_form_box_text">
                            <label for="name1"><span>*</span>QQ :</label>
                        </div>
                        <input type="text" placeholder="请输入您的QQ号码" id="name3" class="QQnumber">
                        <p class="com_form_box_hint_three"></p>
                    </li>
                    <li>
                        <div class="com_form_box_text">
                            <label for="name1"><span>*</span>邮箱:</label>
                        </div>
                        <input type="email" placeholder="请输入您的邮箱" id="name4" class="email">
                        <p class="com_form_box_hint_four"></p>
                    </li>
                    <li>
                        <div class="com_form_box_text">
                            <label for="name5"><span>*</span>备注:</label></div>
                        <textarea name="" id="name5" cols="30" rows="10" placeholder="请输入您的留言"></textarea>
                    </li>
                    <li class="col-12">
                        <a href="">立即发布</a>
                    </li>
                </ul>
                <ul class=" com_form_box_paralleling col-xl-5 col-md-6 col-12">
                    <li>
                        <h3>业务资讯：1300000000</h3>
                        <p>联系QQ：258506508</p>
                        <p>联系邮箱：xxx@.co.m</p>
                        <p>联系电话：020-000000 000-000000</p>
                        <p>联系地址：XXX省XXX市XXX县XXX路XXX号</p>
                        <p></p>
                        <p></p>
                    </li>
                    <li>
                        <p>我们以“诚信、合作、发展”为经营理念，以优质的服务质量为发展的基石。我们期待与您的合作！</p>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <script>
        // 1、姓名
        var nameone = document.querySelector('.name') //姓名  
        var com_form_box_hint1 = document.querySelector('.com_form_box_hint_one')
        var userName = /^[a-zA-Z][0-9a-zA-Z]{6,20}$/
        nameone.onblur = function () {
            if (this.value.length < 1 || this.value.length > 16 || userName.test(nameone.value) != true) {
                com_form_box_hint1.className = "com_form_box_hint_one rong";
                nameone.className = "name com_form_box_show";
                com_form_box_hint1.innerHTML = "请输入7到16位以纯英文字母开头或者和数字组成的名字!"
            } else {
                com_form_box_hint1.className = "com_form_box_hint wong";
                nameone.className = "name com_form_box_pass";
                com_form_box_hint1.innerHTML = " "
            }
        }
        // 2、电话
        // 1、获取元素
        var number = document.querySelector('.number'); //号码
        var com_form_box_hint2 = document.querySelector('.com_form_box_hint_two');
        var checkout = /^1[3456789]\d{9}$/
        // 2、注册事件，失去焦点
        number.onblur = function () {
            // 根据value长度判断是否是6到16位
            if (checkout.test(number.value) != true) {
                com_form_box_hint2.className = "com_form_box_hint_two rong";
                number.className = "number com_form_box_show";
                com_form_box_hint2.innerHTML = "请输入11位数中国大陆正确格式的号码!"
            } else {
                com_form_box_hint2.className = "com_form_box_hint_two wong";
                number.className = "number com_form_box_pass";
                // com_form_box_hint2.innerHTML = "✔ 输入正确！"
                com_form_box_hint3.innerHTML = " "

            }
        }
        // 3、QQ
        // 1、获取元素
        var qqnumber = document.querySelector('.QQnumber') //QQ
        var com_form_box_hint3 = document.querySelector('.com_form_box_hint_three')
        // 2、注册事件，失去焦点
        qqnumber.onblur = function () {
            // 根据value长度
            if (this.value.length < 5 || this.value.length > 10) {
                com_form_box_hint3.className = "com_form_box_hint_three rong";
                qqnumber.className = "QQnumber com_form_box_show";
                com_form_box_hint3.innerHTML = "请输入5到9位的QQ号码!"

            } else {
                com_form_box_hint3.className = "com_form_box_hint_three wong";
                qqnumber.className = "QQnumber com_form_box_pass";
                com_form_box_hint3.innerHTML = " "

            }
        }
        // 4、邮箱
        // 1、获取元素
        var emailnumber = document.querySelector('.email') //QQ
        var com_form_box_hint4 = document.querySelector('.com_form_box_hint_four')
        var impose = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
        // 2、注册事件，失去焦点
        emailnumber.onblur = function () {
            // 根据value长度
            if (impose.test(emailnumber.value) != true) {
                com_form_box_hint4.className = "com_form_box_hint_four rong";
                emailnumber.className = "email com_form_box_show";
                com_form_box_hint4.innerHTML = "请输入正确的邮箱格式!"

            } else {
                com_form_box_hint4.className = "com_form_box_hint_four wong";
                emailnumber.className = "email com_form_box_pass";
                com_form_box_hint4.innerHTML = " "
            }
        }
    </script>
</body>

</html>